﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace DataLayer
{
    public class Resource:SystemFile
    {
        int type;

        public int Type
        {
            get { return type; }
            set { type = value; }
        }
        int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        string path;

        public string Path
        {
            get { return path; }
            set { path = value; }
        }

        public override void AddToXmlDoc(System.Xml.XmlDocument _doc, XmlElement parent)
        {
            XmlElement node = _doc.CreateElement("Resource");

            XmlAttribute typeAtt = _doc.CreateAttribute("type");
            typeAtt.Value = this.type.ToString();
            node.Attributes.Append(typeAtt);

            XmlElement eID = _doc.CreateElement("ID");
            eID.InnerText = this.Id.ToString();
            XmlElement ePath = _doc.CreateElement("Path");
            ePath.InnerText = this.path;

            node.AppendChild(eID);
            node.AppendChild(ePath);

            parent.AppendChild(node);
            
        }
    }
}
